package com.csap.framework.oauth2.type;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * @Author ycf
 * @Date 2021/8/19 6:04 下午
 * @Version 1.0
 */
@AllArgsConstructor
@Getter
public enum ExceptionType {
    /**
     * 枚举信息
     */
    invalid_client("invalid_client", HttpStatus.UNAUTHORIZED, "无效的客户端"),
    invalid_grant("invalid_grant", HttpStatus.BAD_REQUEST, "无效的grant_type"),
    invalid_request("invalid_request", HttpStatus.BAD_REQUEST, "无效的请求"),
    invalid_scope("invalid_scope", HttpStatus.BAD_REQUEST, "无效的作用域"),
    invalid_token("invalid_token", HttpStatus.UNAUTHORIZED, "无效的token"),
    unauthorized_client("unauthorized_client", HttpStatus.BAD_REQUEST, "授权服务器认证客户端，但没有授权"),
    unauthorized_user("unauthorized_user", HttpStatus.BAD_REQUEST, "用户不可用"),
    unsupported_grant_type("unsupported_grant_type", HttpStatus.BAD_REQUEST, "授权服务器不支持的授权模式"),
    unsupported_response_type("unsupported_response_type", HttpStatus.BAD_REQUEST, "返回类型response_type不可用"),
    access_denied("access_denied", HttpStatus.FORBIDDEN, "无访问权限");
    /**
     * 错误信息
     */
    private final String message;
    /**
     * http状态-即是返回数据code状态
     */
    private final HttpStatus httpStatus;
    /**
     * 错误描述
     */
    private final String descr;
}
